import 'package:lcapp/api/request/api_client.dart';
import 'package:lcapp/api/request/response_data.dart';

class MessageAPI {

  static Future<ResponseData> getLastMessage() async {
    ResponseData responseData = await ApiClient.get("/api/message/center/last/message");
    return ResponseData.createFrom(responseData, responseData.data);
  }

  static Future<ResponseData> getMessageList(int page, int size,int session) async {
    ResponseData responseData = await ApiClient.get("/api/message/center/list",queryParameters: {'page':page,'size':size,'session':session});
    return ResponseData.createFrom(responseData, responseData.data);
  }

  static Future<ResponseData> updateMessageState(
      {int? session, int? msgId}) async {
    ResponseData responseData = await ApiClient.post("/api/message/center/update",data: {'session':session,'msgId':msgId});
    return ResponseData.createFrom(responseData, responseData.data);
  }
}